<template>
	<view>
		<uni-row>
			<block>
				微信小程序不支持直接获取用户信息,只用引导用户填写自己信息
			</block>
		</uni-row>
		<uni-row>
			<uni-col span="4">头像</uni-col>
			<uni-col span="20">
				<button open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
					<image class="avatar"  :src="imgUrl"></image>
				</button>
			</uni-col>
		</uni-row>
		<uni-row>
			<uni-col span="4">昵称</uni-col>
			<uni-col span="20">
				<input type="nickname" placeholder="请输入昵称"/>
			</uni-col>
		</uni-row>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgUrl: ''
			};
		},
		methods: {
			onChooseAvatar(data) {
				const { avatarUrl } = data.detail
				this.imgUrl = avatarUrl
			}
		}
	}
</script>

<style lang="scss">

</style>
